import PropTypes from "prop-types";
import styles from "./OrderCardTitle.module.less";
import { Tag } from "antd-mobile";

const OrderCardTitle = (props) => {
  return (
    <div className={styles["order-card-title"]}>
      <span className={styles["title-txt"]}>{props.title}</span>
      {props.status ? (
        <Tag color={props.status === "TODO" ? "warning" : "danger"}>
          {props.status === "TODO" ? "待提交" : "提交失败"}
        </Tag>
      ) : null}
    </div>
  );
};

OrderCardTitle.propTypes = {
  title: PropTypes.string,
  status: PropTypes.string,
};

export default OrderCardTitle;
